import { Breadcrumb, Layout, Menu, message } from "antd";
import { UserOutlined } from "@ant-design/icons";
import { Switch } from "react-router";

import React from "react";

const { Content, Sider } = Layout;

function Spider(props) {
  const goToPage = (value) => {
    if (!value.key) {
      message.info("暂无链接");
      return false;
    }
    props.history.push(value.key);
  };
  return (
    <Layout>
      <Sider width={200} className="site-layout-background">
        <Menu
          mode="inline"
          defaultSelectedKeys={["1"]}
          defaultOpenKeys={["sub1"]}
          style={{ height: "100%", borderRight: 0 }}
        >
          <Menu.Item
            key=""
            id="spider_POI"
            onClick={goToPage}
            icon={<UserOutlined />}
          >
            POI
          </Menu.Item>
          {/* <Menu.Item
            key=""
            id="spider_AOI"
            onClick={goToPage}
            icon={<LaptopOutlined />}
          >
            AOI
          </Menu.Item> */}
        </Menu>
      </Sider>
      <Layout style={{ padding: "0 24px 24px" }}>
        <Breadcrumb style={{ margin: "16px 0" }}>
          <Breadcrumb.Item>测试</Breadcrumb.Item>
        </Breadcrumb>
        <Content
          className="site-layout-background"
          style={{
            padding: 24,
            margin: 0,
            minHeight: 280,
          }}
        >
          <Switch></Switch>
        </Content>
      </Layout>
    </Layout>
  );
}

export default Spider;
